package cn.acewill.yxd.yunxundian.ui.sign.Presenter;

import android.util.Log;

import java.io.IOException;
import java.util.HashMap;

import cn.acewill.yxd.yunxundian.pubClass.OkHttpManger;
import cn.acewill.yxd.yunxundian.pubClass.pubClass;
import cn.acewill.yxd.yunxundian.ui.sign.Contract.MEvaLoadListener;
import cn.acewill.yxd.yunxundian.ui.sign.Contract.OEvaLoadModel;

/**
 * Created by xxx on 2018/1/12.
 */

public class OEvaLoadModelIml implements OEvaLoadModel{

    //他人评估数据
    @Override
    public void loadOtherSchedule(int empid, String year, String month, final MEvaLoadListener listener) {
        HashMap<String,String> map = new HashMap<>();
        map.put("task","loadOtherOESchedule");
        map.put("empid",String.valueOf(empid));
        map.put("year",String.valueOf(year));
        map.put("month",String.valueOf(month));
        Log.e("map",map.toString());
        try {
            OkHttpManger.getInstance().postAsync(pubClass.Server_namehzm, new OkHttpManger.MyCallback() {
                @Override
                public void onSuccess(String result) {
                    listener.onRequestSuccess(result);
                }

                @Override
                public void onFailture() {
                    listener.onRequestEro();
                }
            },map);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    //加载门店的数据
    @Override
    public void loadOtherShopInfo(int empid, String year, String month, final MEvaLoadListener listener) {
        HashMap<String,String> map = new HashMap<>();
        map.put("task","getTongShiSch");
        map.put("empid",String.valueOf(empid));
        map.put("year",String.valueOf(year));
        map.put("month",String.valueOf(month));
        Log.e("map",map.toString());
        try {
            OkHttpManger.getInstance().postAsync(pubClass.Server_namehzm, new OkHttpManger.MyCallback() {
                @Override
                public void onSuccess(String result) {
                    listener.onRequestSuccess(result);
                }

                @Override
                public void onFailture() {
                    listener.onRequestEro();
                }
            },map);
        } catch (IOException e) {
            e.printStackTrace();
        }


    }

}
